/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package slishome;

/**
 *
 * @author Rebecca
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;

/**
 *
 * @author ITC
 */
public class ReadFromWeb {

    /**
     * @param args the command line arguments
     */
    public static String readFromWeb() {
        
            try {
    // Create a URL for the desired page          
   URL url = new URL("http://csee.wvu.edu/seniordesign/Fall2011-480-Group09/Answers.txt");
            try (BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()))) {
                String str = in.readLine();
                return str;
            }
    } catch (MalformedURLException e) {
        System.out.println("MalformedURL");
        return null;
    } catch (IOException e) {
        System.out.println("IOException");
        return null;
    }
    }
}